<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="s_person" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="applyUpSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
      <el-button @click="gotoPage('/oa/humanresources/ApplyDet?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>取消</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 员工基本信息 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="姓名" prop="person_name">
              <el-input v-model="s_person.person_name" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="性别" prop="person_sex">
              <el-radio-group v-model="s_person.person_sex">
                <el-radio-button label="男">男</el-radio-button>
                <el-radio-button label="女">女</el-radio-button>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="出生年月" prop="person_birthday">
              <el-date-picker v-model="s_person.person_birthday" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="民族" prop="person_ethnic">
              <el-select style='width:100%' v-model="s_person.person_ethnic">
                <el-option label="汉族" value="汉族" />
                <el-option label="蒙古族" value="蒙古族" />
                <el-option label="回族" value="回族" />
                <el-option label="壮族" value="壮族" />
                <el-option label="维吾尔族" value="维吾尔族" />
                <el-option label="藏族" value="藏族" />
                <el-option label="苗族" value="苗族" />
                <el-option label="彝族" value="彝族" />
                <el-option label="布依族" value="布依族" />
                <el-option label="朝鲜族" value="朝鲜族" />
                <el-option label="满族" value="满族" />
                <el-option label="侗族" value="侗族" />
                <el-option label=" 瑶族" value=" 瑶族" />
                <el-option label="白族" value="白族" />
                <el-option label="土家族" value="土家族" />
                <el-option label="哈尼族" value="哈尼族" />
                <el-option label="哈萨克族" value="哈萨克族" />
                <el-option label="傣族" value="傣族" />
                <el-option label="黎族" value="黎族" />
                <el-option label="僳僳族" value="僳僳族" />
                <el-option label="佤族" value="佤族" />
                <el-option label="畲族" value="畲族" />
                <el-option label="拉祜族" value="拉祜族" />
                <el-option label="水族" value="水族" />
                <el-option label="东乡族" value="东乡族" />
                <el-option label="纳西族" value="纳西族" />
                <el-option label="景颇族" value="景颇族" />
                <el-option label="柯尔克孜族" value="柯尔克孜族" />
                <el-option label="土族" value="土族" />
                <el-option label="达斡尔族" value="达斡尔族" />
                <el-option label="仫佬族" value="仫佬族" />
                <el-option label="仡佬族" value="仡佬族" />
                <el-option label="羌族" value="羌族" />
                <el-option label="锡伯族" value="锡伯族" />
                <el-option label="布朗族" value="布朗族" />
                <el-option label="撒拉族" value="撒拉族" />
                <el-option label="毛南族" value="毛南族" />
                <el-option label="阿昌族" value="阿昌族" />
                <el-option label="普米族" value="普米族" />
                <el-option label="塔吉克族" value="塔吉克族" />
                <el-option label="怒族" value="怒族" />
                <el-option label="乌孜别克族" value="乌孜别克族" />
                <el-option label="俄罗斯族" value="俄罗斯族" />
                <el-option label="鄂温克族" value="鄂温克族" />
                <el-option label="德昂族" value="德昂族" />
                <el-option label="保安族" value="保安族" />
                <el-option label="裕固族" value="裕固族" />
                <el-option label="京族" value="京族" />
                <el-option label="基诺族" value="基诺族" />
                <el-option label="高山族" value="高山族" />
                <el-option label="塔塔尔族" value="塔塔尔族" />
                <el-option label="独龙族" value="独龙族" />
                <el-option label="鄂伦春族" value="鄂伦春族" />
                <el-option label="赫哲族" value="赫哲族" />
                <el-option label="门巴族" value="门巴族" />
                <el-option label="珞巴族" value="珞巴族" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="籍贯" prop="person_local">
              <el-input v-model="s_person.person_local" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="政治面貌" prop="person_politics">
              <el-select style='width:100%' v-model="s_person.person_politics">
                <el-option label="－－无－－" value='' />
                <el-option v-for="dict in l_pf" :key="dict.__code" :label="dict.__desc" :value="dict.__code"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="婚姻状况" prop="person_ismarry">
              <el-select style='width:100%' v-model="s_person.person_ismarry">
                <el-option label="已婚" value="已婚" />
                <el-option label="未婚" value="未婚" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="健康状况" prop="person_health">
              <el-input v-model="s_person.person_health" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="职业资格证书" prop="person_cdt">
              <el-input v-model="s_person.person_cdt" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="取得时间" prop="person_getcdtdate">
              <el-date-picker v-model="s_person.person_getcdtdate" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="学历学位" prop="person_level">
              <el-input v-model="s_person.person_level" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="照片上传" prop="">
              <input type=file />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 学历学位 </span>
      </div>
      <el-table :data="s_level">
        <el-table-column label="就读院校" prop="level_academy">
          <template slot-scope="scope">
            <el-input v-model="scope.row.level_academy" />
          </template>
        </el-table-column>
        <el-table-column label="就读时间" prop="level_bgdate">
          <template slot-scope="scope">
            <el-date-picker v-model="scope.row.level_bgdate" type="date" style='width:100%' value-format="yyyy-MM-dd" />
          </template>
        </el-table-column>
        <el-table-column label="毕业时间" prop="level_edate">
          <template slot-scope="scope">
            <el-date-picker v-model="scope.row.level_edate" type="date" style='width:100%' value-format="yyyy-MM-dd" />
          </template>
        </el-table-column>
      </el-table>
      <div class="form-unit">
        <span class="mvc-title-left"> 工作经历 </span>
      </div>
      <el-table :data="s_wkundergo">
        <el-table-column label="工作单位" prop="undergo_nunit">
          <template slot-scope="scope">
            <el-input v-model="scope.row.undergo_nunit" />
          </template>
        </el-table-column>
        <el-table-column label="部门" prop="undergo_post">
          <template slot-scope="scope">
            <el-input v-model="scope.row.undergo_post" />
          </template>
        </el-table-column>
        <el-table-column label="职务" prop="undergo_level">
          <template slot-scope="scope">
            <el-input v-model="scope.row.undergo_level" />
          </template>
        </el-table-column>
        <el-table-column label="任职时间" prop="undergo_date">
          <template slot-scope="scope">
            <el-date-picker v-model="scope.row.undergo_date" type="date" style='width:100%' value-format="yyyy-MM-dd" />
          </template>
        </el-table-column>
      </el-table>
      <div class="form-unit">
        <span class="mvc-title-left"> 技能 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="技能特长" prop="skill_speciality">
              <el-input v-model="s_skill.skill_speciality" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="外语水平" prop="skill_english">
              <el-input v-model="s_skill.skill_english" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="计算机水平" prop="skill_computer">
              <el-input v-model="s_skill.skill_computer" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="省部级以上奖励" prop="skill_reward">
              <el-input v-model="s_skill.skill_reward" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="何时何地受过何种处分" prop="skill_punish">
              <el-input v-model="s_skill.skill_punish" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="自我评价" prop="skill_assess">
              <el-input type="textarea" v-model="s_skill.skill_assess" ttparea=350></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 通讯信息 </span>
      </div>
      <el-table :data="s_relation">
        <el-table-column label="电话" prop="relation_tel">
          <template slot-scope="scope">
            <el-input v-model="scope.row.relation_tel" />
          </template>
        </el-table-column>
        <el-table-column label="手机" prop="relation_cel">
          <template slot-scope="scope">
            <el-input v-model="scope.row.relation_cel" />
          </template>
        </el-table-column>
        <el-table-column label="E-mail" prop="relation_email">
          <template slot-scope="scope">
            <el-input v-model="scope.row.relation_email" />
          </template>
        </el-table-column>
      </el-table>
      <div class="form-unit">
        <span class="mvc-title-left"> 家庭信息 </span>
      </div>
      <el-table :data="s_mem">
        <el-table-column label="姓名" prop="mem_name">
          <template slot-scope="scope">
            <el-input v-model="scope.row.mem_name" />
          </template>
        </el-table-column>
        <el-table-column label="关系" prop="mem_level">
          <template slot-scope="scope">
            <el-select style='width:100%' v-model="scope.row.mem_level">
              <el-option label="父子" value="父子" />
              <el-option label="母子" value="母子" />
            </el-select>
          </template>
        </el-table-column>
        <el-table-column label="职业" prop="mem_prof">
          <template slot-scope="scope">
            <el-input v-model="scope.row.mem_prof" />
          </template>
        </el-table-column>
        <el-table-column label="现处在单位" prop="mem_unit">
          <template slot-scope="scope">
            <el-input v-model="scope.row.mem_unit" />
          </template>
        </el-table-column>
        <el-table-column label="电话" prop="mem_tel">
          <template slot-scope="scope">
            <el-input v-model="scope.row.mem_tel" />
          </template>
        </el-table-column>
        <el-table-column label="手机" prop="mem_cel">
          <template slot-scope="scope">
            <el-input v-model="scope.row.mem_cel" />
          </template>
        </el-table-column>
      </el-table>
      <el-button @click="applyUpSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
      <el-button @click="gotoPage('/oa/humanresources/ApplyDet?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>取消</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'ApplyUp',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_person: {
          person_name: null,
          person_sex: null,
          person_birthday: null,
          person_ethnic: null,
          person_local: null,
          person_politics: null,
          person_ismarry: null,
          person_health: null,
          person_cdt: null,
          person_getcdtdate: null,
          person_level: null,
        },
        s_level: [],
        s_wkundergo: [],
        s_skill: {
          skill_speciality: null,
          skill_english: null,
          skill_computer: null,
          skill_reward: null,
          skill_punish: null,
          skill_assess: null,
        },
        s_relation: [],
        s_mem: [],
        l_pf: [],
        loading: false,
        rules: {
          person_name: [{
            required: true,
            message: "姓名不能为空",
            trigger: 'blur',
          }],
          person_ismarry: [{
            required: true,
            message: "婚姻状况不能为空",
            trigger: 'blur',
          }],
        }
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/oa/humanresources/InterviewAction/applyUp?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      applyUpSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/oa/humanresources/InterviewAction/applyUpSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/oa/humanresources/ApplyDet/applyDet?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
